package com.ljs.liojbackendjudgeservice.judge.codesandbox.imp;



import com.ljs.libackendmodel.model.codesandbox.ExecuteCodeRequest;
import com.ljs.libackendmodel.model.codesandbox.ExecuteCodeResponse;
import com.ljs.libackendmodel.model.codesandbox.QuestionJudgeInfo;
import com.ljs.libackendmodel.model.enums.JudgeInfoMessageEnum;
import com.ljs.libackendmodel.model.enums.QuestionSubmitStatusEnum;
import com.ljs.liojbackendjudgeservice.judge.codesandbox.CodeSandbox;

import java.util.List;

/**
 * 示例代码沙箱（仅跑通项目）
 */
public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        ExecuteCodeResponse executeCodeResponse=new ExecuteCodeResponse();
        List<String> inputLists = executeCodeRequest.getInputLists();
        QuestionJudgeInfo questionJudgeInfo = new QuestionJudgeInfo();
        questionJudgeInfo.setMessage(JudgeInfoMessageEnum.Accepted.getText());
        questionJudgeInfo.setStackLimit(100L);
        questionJudgeInfo.setTime(100L);
        executeCodeResponse.setOutputLists(inputLists);
        executeCodeResponse.setMessage("测试成功");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
        executeCodeResponse.setQuestionJudgeInfo(questionJudgeInfo);
        return executeCodeResponse;
    }
}
